<%--
  Created by IntelliJ IDEA.
  User: 14533
  Date: 2021/11/4
  Time: 11:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <form action="upload" method="post" enctype="multipart/form-data" name="form1" id="form1">
        文件名:<input type="file" name="file" id="file" onchange="submitForm()"/>
        <input type="button" name="button" id="button" value="提交" onclick="sendReq()"/>
    </form>

    头像：<img src="img/timg.gif" alt="" id="img" onclick="selectImg()">
    <script type="text/javascript">
        function selectImg() {
            document.getElementById("file").click();
        }
        function submitForm() {
            document.getElementById("form1").click();
        }
    </script>
</body>
</html>
